import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name:'layout',
      component: () => import("../views/Layout/index.vue"),
      children: [
        {
          path: "system",
          name: "system",
          component: () => import("../views/System/index.vue"),
          meta: { title: "系统管理 / 系统账号" },
        },
        {
          path: "role",
          name: "role",
          component: () => import("../views/Role/index.vue"),
          meta: { title: "系统管理 / 角色列表" },
        },
        {
          path: "list",
          name: "list",
          component: () => import("../views/List/index.vue"),
          meta: { title: "用户管理 / 用户列表" },
        },
        {
          path: "cardlist",
          name: "cardlist",
          component: () => import("../views/CardList/index.vue"),
          meta: { title: "订单管理 / 订单列表" },
        },
        {
          path: "return",
          name: "return",
          component: () => import("../views/Return/index.vue"),
          meta: { title: "订单管理 / 退货订单" },
        },
        {
          path: "notice",
          name: "notice",
          component: () => import("../views/Notice/index.vue"),
          meta: { title: "广告管理 / 广告列表" },
        },
        {
          path: "suit",
          name: "suit",
          component: () => import("../views/Suit/index.vue"),
          meta: { title: "套装管理 / 套装商品" },
        },
        {
          path: "suitcategory",
          name: "suitcategory",
          component: () => import("../views/SuitCategory/index.vue"),
          meta: { title: "套装管理 / 套装分类" },
        },
        {
          path: "shopcategory",
          name: "shopcategory",
          component: () => import("../views/ShopCategory/index.vue"),
          meta: { title: "商品管理 / 商品分类" },
        },
        {
          path: "shoplist",
          name: "shoplist",
          component: () => import("../views/ShopList/index.vue"),
          meta: { title: "商品管理 / 商品列表" },
        },
      ],
    },
  ],
});

export default router;
